<?php 
$this->jQuery()->enable()
				->addJavascriptFile($this->baseUrl().'/js/frontent.js');
echo $this->translate->_(' ');
echo $this->translate->_('Books').':';		
echo $this->number;		
/* foreach($this->paginator as $book){
	echo $book['title'].'<b>by</b>'.$book['author'].'<br/>';
}
 */?>
<div id="booksResponse" >
<?php
foreach($this->books as $book){
	$details = 'written by:';
	$books = $book->getAuthor();
	
	$i = 0;
	$numBooks = count($book);	
	foreach($books as $author){
		$details = $book->getAuthor()->getFullName();
		if($i<$numBooks - 1){
			$details.=',';
		}
		$i++;
	}			
	$details.='<br />Comments:<dl>';
	
	
	foreach($book->getComments($this->url(array('controller'=>'comment', 'action'=>'edit'))) as $comment){
		$details.='<dt>'.$comment->getUser().'</dt>'.
					'<dd>'.$comment->getComment().'</dd>';
	}
		$details.='</dl>';
		echo $this->accordionPane('books', $details,
									array('title'=>$book->getTitle()));
	
}

echo $this->accordionContainer('books', 
								array('active'=>'none', 'collapsible' => 'true'));
?>
</div>
<p></p>

<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml');?>

<?= $this->ajaxLink('test', 
					$this->url(array('page'=>'2')),
							array('id'=>'test', 'complete'=>'displayBooks(data);', 'method' => 'post'),
							array('format' => 'json')); ?>

							
							
							